"""
扫描模式页面
"""
import uiautomation as auto
from utils.utils_log import loggerCase
from page.base_page import BasePage
from common_ai_img import AIButton, AIInputBox, Icon, OcrText

class ScanModePage(BasePage):
    """
    扫描模式页面
    """

    # LASER模式
    __laser_mode = AIButton(OcrText("Laser Mode"))

    # IR模式
    __ir_mode = AIButton(OcrText("IR Mode"))

    # 工程名输入框
    __name_editor = AIButton(Icon("name edit"))

    # 浏览按钮
    __browse_button = AIButton(OcrText("Browse"))

    # 桌面
    __desktop_button = AIButton(OcrText("Desktop"))

    # 电脑
    __computer_button = AIButton(OcrText("Computer"))

    # 选择
    __select_button = AIButton(OcrText("Select"))

    def click_laser_mode(self):
        """选择激光模式"""
        loggerCase.info("点击激光模式")
        self.click(self.__laser_mode, max_wait_time=5)
        self.loading()

    def click_ir_mode(self):
        """选择无光模式"""
        loggerCase.info("点击无光模式")
        self.click(self.__ir_mode, max_wait_time=10)

    def edit_name_editor(self, text):
        """输入文件名称"""
        loggerCase.info("文件名称为" + text)
        self.send_key(self.__name_editor, text)

    def click_browse_button(self):
        """Browse"""
        loggerCase.info("点击Browse按钮")
        self.click(self.__browse_button)

    def click_desktop_button(self):
        """桌面"""
        loggerCase.info("点击桌面按钮")
        self.click(self.__desktop_button)

    def click_select_button(self):
        """选择"""
        loggerCase.info("点击选择按钮")
        self.click(self.__select_button)

if __name__ == '__main__':
    ScanModePage().edit_name_editor("1111")